import request from '@/utils/request'

export function add(data) {
  return request({
    url: '/oauth/user/save',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: '/oauth/user/delete',
    method: 'post',
    data: [id]
  })
}

export function edit(data) {
  return request({
    url: '/oauth/user/save',
    method: 'post',
    data
  })
}

export function get(id) {
  return request({
    url: '/oauth/user/get',
    method: 'get',
    params: { id }
  })
}

export function getRoles() {
  return request({
    url: '/oauth/user/getRoles',
    method: 'get'
  })
}
